


import Vue from 'vue'
// const  requireComponent=require.context('公共组件的目录','是否深层次查找',正则[以.vue文件结尾的都是我们要找的])
const requireComponent = require.context('./', true, /.vue$/)
console.log(requireComponent.keys(), 222);
// requireComponent.keys()//  ['./Breadcrumb/index.vue', './Hamburger/index.vue', './SvgIcon/index.vue', './toolPage/index.vue'] 222
requireComponent.keys().forEach(item => {
  console.log(requireComponent(item), 888);
  var defaultCom = requireComponent(item).default  //  获取的就是组件暴露出来的对象
  Vue.component(defaultCom.name, defaultCom)
})







// import toolPage from '@/components/toolPage'
// export default {
//   install: function (Vue) {
//     Vue.component('toolPage', toolPage)
//   }
// }